package cc.zy.base.businesses.mapper;

import cc.zy.base.businesses.entity.NetworkSchool;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 民族表
 * Mapper
 *
 * @author LiXu
 * @date 2021-03-01 20:17:02
 */
public interface NetworkSchoolMapper extends BaseMapper<NetworkSchool> {

    /**
     * 根据id和openId查找
     *
     * @Author hutengjiao
     * @Date: 2021/4/6 13:43
     * @param [id, openId]
     * @return cc.zy.base.businesses.entity.NetworkSchool
     */
    NetworkSchool getByIdAndOpenId(@Param("id") Integer id);

    /**
     * 学生缴纳报名费后分配233网校的用户名密码
     *
     * @Author hutengjiao
     * @Date: 2021/4/6 13:44
     * @param [networkSchool]
     * @return int
     */
    int updateNetworkSchool(@Param("networkSchool") NetworkSchool networkSchool);

    /**
     * 短信发送成功后回填数据
     *
     * @Author hutengjiao
     * @Date: 2021/4/14 18:22
     * @param [networkSchool, id]
     * @return int
     */
    int callbackNetWorkSchool(@Param("networkSchool") NetworkSchool networkSchool, @Param("id") Integer id);

    /**
     * 查询列表
     *
     * @Author hutengjiao
     * @Date: 2021/4/19 13:48
     * @param [networkSchool]
     * @return java.util.List<cc.zy.base.businesses.entity.NetworkSchool>
     */
    <T> IPage<NetworkSchool> listNetworkSchool(Page<T> page, @Param("networkSchool") NetworkSchool networkSchool);

    /**
     * 查询所有分页总数
     *
     * @Author hutengjiao
     * @Date: 2021/4/19 14:03
     * @param [networkSchool]
     * @return long
     */
    long countNetworkSchool(@Param("networkSchool") NetworkSchool networkSchool);

    /**
     * 获取报名费列表
     *
     * @Author hutengjiao
     * @Date: 2021/4/19 16:38
     */
    List<Map<String, Object>> selectOriginalPrice();

    /**
     * 导入数据，存在就修改，不存在插入
     *
     * @Author hutengjiao
     * @Date: 2021/4/20 17:18
     * @param [networkSchool]
     * @return int
     */
    int addUsername(List<NetworkSchool> networkSchool);

    /**
     * 查找状态
     *
     * @Author hutengjiao
     * @Date: 2021/4/20 17:57
     * @param [usernames]
     * @return java.util.List<cc.zy.base.businesses.entity.NetworkSchool>
     */
    List<NetworkSchool> selectByUid(@Param("usernames") ArrayList<String> usernames);

    /**
     * 查询所有，不带分页
     *
     * @Author hutengjiao
     * @Date: 2021/4/21 11:59
     * @param [networkSchool]
     * @return java.util.List<cc.zy.base.businesses.entity.NetworkSchool>
     */
    List<NetworkSchool> listNetworkSchool(@Param("networkSchool") NetworkSchool networkSchool);

    /**
     * 清空账号信息
     *
     * @Author hutengjiao
     * @Date: 2021/4/21 14:36
     * @param [username]
     * @return int
     */
    int resetUsername(@Param("username") String username);

    /**
     * 添加备注
     *
     * @Author hutengjiao
     * @Date: 2021/4/21 15:11
     * @param [remark, username]
     * @return int
     */
    int addRemark(@Param("remark") String remark, @Param("username") String username);
}